<?php

define('NO_SESSION','1');

require_once 'lib/init.php';


#################################
# Clear Ampache's playlist data	#
#################################
# Author:
# ------
# Sam Dekeyser
# 
# Usage:
# ------
# run
#		php clear_playlists.php
###################
#
# Based upon Ampache's lib/class/playlist.class.php #delete
#
# MIT License
#

print "Deleting all playlists and related data...\n";

# Delete all playlist_data
$sql = "TRUNCATE TABLE `playlist_data`";
$db_results = Dba::query($sql);

# Delete all playlists
$sql = "TRUNCATE TABLE `playlist`";
$db_results = Dba::query($sql);

# Delete all object counts for playlists
$sql = "DELETE FROM `object_count` WHERE `object_type`='playlist'";
$db_results = Dba::query($sql); 

print "Finished.\n";

?>

